{% extends "base.html" %}
{% load i18n %}

{% block title %}{% trans "Login" %}{% endblock title %}

{% block custom_styles %}
<link rel="stylesheet" href="/static/styles/openid.css" />
<link rel="stylesheet" href="/static/styles/crud.css" />
{% endblock custom_styles %}

{% block custom_scripts %}
<script type="text/javascript" src="/static/js/openid-jquery.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
	    openid.init('openid_identifier');
	});
</script>
{% endblock custom_scripts %}


{% block content %}

{% if form.errors %}
<p>{% trans "Your username and password didn't match. Please try again" %}</p>
{% endif %}



<div id="login-wrapper">
	
	<div id="login">
		
		
		<div class="login_option">
		<div class="login_option_title">{% trans "Through User Account" %}</div>
		
		<form method="post" action="{% url django.contrib.auth.views.login %}" id="login_form">
			{% csrf_token %}
			<input type="hidden" name="next" value="{{ next }}" />
			
			<div class="form_field_wrapper">
				{% if field.errors %}
				<div class="form_field_error">{{ field.errors }}</div>
				{% endif %}
				<div class="form_field">
					<div class="form_field_label">
						{{ form.username.label_tag }}:
					</div>
					<div class="form_field_input">
						{{ form.username }}
					</div> 
					<br class="clear" />
				</div>
			</div>
			
			<div class="form_field_wrapper">
				{% if field.errors %}
				<div class="form_field_error">{{ field.errors }}</div>
				{% endif %}
				<div class="form_field">
					<div class="form_field_label">
						{{ form.password.label_tag }}:
					</div>
					<div class="form_field_input">
						{{ form.password }}
					</div> 
					<br class="clear" />
				</div>
			</div>
			
			<div class="form_buttons">
				<input type="submit" value='{% trans "Login" %}' class="form_button" />
			</div>
			<a href="/settings/password_reset/">{% trans 'Forgot passwprd?' %}</a>
		</form>
		</div>
	</div>
	
	<div id="openid">

		<!-- 
			{% trans "Please click your account provider" %}:
		-->	
		
		<div class="login_option">
		<div class="login_option_title">{% trans "Sign-in or Create New Account via these openid providers" %}</div>
		
		<form action="{% url socialauth_openid_login %}" method="get" id="openid_form">
			<input type="hidden" name="action" value="verify" />
			<input type="hidden" name="openid_next" value="{{ next }}">
			
			<div id="openid_btns">
				
				{% if FACEBOOK_APP_ID %}
					<div id="facebook">
						<p><fb:login-button perms="{{ login_button_perms }}"></fb:login-button></p>
					</div>	  
				{% endif %}
				
				<!-- 
				<div id="linkedin">
					<a href="{% url socialauth_linkedin_login %}?next={{ next }}" id="linkedin_login_link" class="openid_large_btn linkedin"></a>
				</div>
				
				<div id="twitter">
					<a href="{% url socialauth_twitter_login %}?next={{ next }}" id="twitter_login_link" class="openid_large_btn twitter"></a>
				</div>
				-->
				
				<div id="openid_input_area">
					<input id="openid_identifier" name="openid_identifier" type="text" value="http://" />
					<input id="openid_submit" type="submit" value="Sign-In"/>
				</div>
				
			</div>
			
		</form>
		</div>	
	</div>
	
	<div id="signup">
		<div class="login_option">
		<div class="login_option_title">{% trans "Sign Up" %}</div>
		<br class="clear"/>
		<br class="clear"/>
		<a href="/core/signup/">{% trans "Sign Up" %}</a>
		</div>
	</div>
	
	<br class="clear"/>

</div>


{% endblock content %}
